﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Exercise17
{
    internal class StrFun
    {
        public string Restring;
        User UserCtrl;
        public User GetResult(string InString)
        {
            UserCtrl = new User(false, "Pass");
            if (string.IsNullOrEmpty(InString)) { UserCtrl.bIsNull = true; UserCtrl.StrMsg = " is null "; return UserCtrl; }
            char[] InChars = InString.ToLower().ToCharArray();
            for (int i = 0;i<InChars.Length;i++) {
                if (char.IsLower(InChars[i])) {
                    if (InChars[i] > 'w' && InChars[i] <= 'z') {
                        InChars[i] = (char)(InString[i] + 3 - 26);                        
                    }
                    else InChars[i] = (char)(InString[i] + 3);                    
                }
            }
            Restring = new string(InChars);
            return UserCtrl;
        }
        
    }
}
